import service from '@/utils/request'

export const getUnitList = (params) => {
  return service({
    url: '/manager/unit/tree',
    method: 'get',
    params
  })
}

export const deleteUnit = (id) => {
  return service({
    url: `/manager/unit/delete/${id}`,
    method: 'post'
  })
}

export const createUnit = (data) => {
  return service({
    url: '/manager/unit/add',
    method: 'post',
    data
  })
}

export const updateUnit = (data) => {
  return service({
    url: '/manager/unit/edit',
    method: 'post',
    data
  })
}

export const createRegion = (data) => {
  return service({
    url: '/manager/region/add',
    method: 'post',
    data
  })
}

export const getRegionList = () => {
  return service({
    url: '/manager/region/tree',
    method: 'get'
  })
}

export const deleteRegion = (id) => {
  return service({
    url: `/manager/region/delete/${id}`,
    method: 'post'
  })
}

export const updateRegion = (data) => {
  return service({
    url: '/manager/region/edit',
    method: 'post',
    data
  })
}

export const unitBaseInfo = (params) => {
  return service({
    url: '/client/unit/base/info',
    method: 'get',
    params
  })
}

export const unitStaff = (params) => {
  return service({
    url: '/client/unit/staff',
    method: 'get',
    params
  })
}

export const unitDepartment = (params) => {
  return service({
    url: '/client/unit/department',
    method: 'get',
    params
  })
}

export const unitBuilding = (params) => {
  return service({
    url: '/client/unit/building',
    method: 'get',
    params
  })
}

export const unitSaveInfo = (data) => {
  return service({
    url: '/client/unit/save/info',
    method: 'post',
    data
  })
}

export const unitSaveStaff = (data) => {
  return service({
    url: '/client/unit/save/staff',
    method: 'post',
    data
  })
}
export const unitSaveDepartment = (data) => {
  return service({
    url: '/client/unit/save/department',
    method: 'post',
    data
  })
}

export const buildingAll = (params) => {
  return service({
    url: '/manager/building/all',
    method: 'get',
    params
  })
}
export const addBuilding = (data) => {
  return service({
    url: '/client/unit/add/building',
    method: 'post',
    data
  })
}

export const cancelBuilding = (id) => {
  return service({
    url: `/client/unit/cancel/building/${id}`,
    method: 'post'
  })
}

export const editBuilding = (data) => {
  return service({
    url: '/client/unit/edit/building',
    method: 'post',
    data
  })
}

export const buildingProperty = (id) => {
  return service({
    url: `/client/unit/building/property/${id}`,
    method: 'get'
  })
}

export const addBuildingProperty = (data) => {
  return service({
    url: '/client/unit/add/building/property',
    method: 'post',
    data
  })
}

export const editBuildingProperty = (data) => {
  return service({
    url: '/client/unit/edit/building/property',
    method: 'post',
    data
  })
}
export const deteleBuildingProperty = (id) => {
  return service({
    url: `/client/unit/delete/building/property/${id}`,
    method: 'post'
  })
}
export const unitRoom = (params) => {
  return service({
    url: '/client/unit/room',
    method: 'get',
    params
  })
}

export const allUr = (params) => {
  return service({
    url: '/manager/dictionary/ur/all',
    method: 'get',
    params
  })
}

export const addRoom = (data) => {
  return service({
    url: '/client/unit/add/room',
    method: 'post',
    data
  })
}

export const editRoom = (data) => {
  return service({
    url: '/client/unit/edit/room',
    method: 'post',
    data
  })
}

export const delRoom = (data) => {
  return service({
    url: '/client/unit/delete/room',
    method: 'post',
    data
  })
}

export const unitEmployee = (params) => {
  return service({
    url: '/client/unit/employee',
    method: 'get',
    params
  })
}

export const deleteEmployee = (id) => {
  return service({
    url: `/client/unit/delete/employee/${id}`,
    method: 'post'
  })
}

export const addEmployee = (data) => {
  return service({
    url: '/client/unit/add/employee',
    method: 'post',
    data
  })
}

export const editEmployee = (data) => {
  return service({
    url: '/client/unit/edit/employee',
    method: 'post',
    data
  })
}

export const technologyList = (id) => {
  return service({
    url: `/client/unit/technology/room/${id}`,
    method: 'get'
  })
}

export const deleteTechnology = (id) => {
  return service({
    url: `/client/unit/delete/technology/room/${id}`,
    method: 'post'
  })
}

export const addTechnology = (data) => {
  return service({
    url: '/client/unit/add/technology/room',
    method: 'post',
    data
  })
}

export const editTechnology = (data) => {
  return service({
    url: '/client/unit/edit/technology/room',
    method: 'post',
    data
  })
}
export const juniorList = () => {
  return service({
    url: '/client/unit/junior/list',
    method: 'get'
  })
}

export const unitBuildingById = (id) => {
  return service({
    url: `/manager/unit/building/${id}`,
    method: 'get'
  })
}

export const unitStaffById = (id) => {
  return service({
    url: `/manager/unit/staff/${id}`,
    method: 'get'
  })
}

export const roomExceed = () => {
  return service({
    url: '/client/unit/room/exceed',
    method: 'get'
  })
}

export const exceedReason = (data) => {
  return service({
    url: '/client/unit/room/exceed/reason',
    method: 'post',
    data
  })
}

export const unitRooms = (id) => {
  return service({
    url: `/manager/unit/room/${id}`,
    method: 'get'
  })
}

export const unitRoomExceed = (id) => {
  return service({
    url: `/manager/unit/room/exceed/${id}`,
    method: 'get'
  })
}

export const roomDetail = (params) => {
  return service({
    url: '/manager/unit/room/detail',
    method: 'get',
    params
  })
}

export const unitReport = (data) => {
  return service({
    url: '/client/unit/report',
    method: 'post',
    data
  })
}

export const unitPdf = (params) => {
  return service({
    url: '/client/unit/data/pdf',
    method: 'get',
    params
  })
}

export const dataReport = (regionId,params) => {
  return service({
    url: `/client/unit/manage/data/report/${regionId}`,
    method: 'get',
    params
  })
}

export const dataContrast = (params) => {
  return service({
    url: '/client/unit/history/data/contrast',
    method: 'get',
    params
  })
}

export const unitLedger = (params) => {
  return service({
    url: '/manager/unit/ledger',
    method: 'get',
    params
  })
}

export const unitLists = (params) => {
  return service({
    url: '/manager/unit/list',
    method: 'get',
    params
  })
}

export const reportNumbers = (params) => {
  return service({
    url: '/manager/unit/report/numbers',
    method: 'get',
    params
  })
}

export const exceedStatist = (params) => {
  return service({
    url: '/manager/unit/exceed/statist',
    method: 'get',
    params
  })
}

export const exceedStatistTotal = (params) => {
  return service({
    url: '/manager/unit/exceed/statist/total',
    method: 'get',
    params
  })
}
